package com.shihc.spring.transaction.dao;

import com.shihc.spring.transaction.model.User;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * Created by shihc on 2016/1/21.
 */
@Repository
public interface UserDao extends CrudRepository<User, Long> {
    /*int saveUser(User user);

    int updateUser(User user);*/

//    @Query("select a from AccountInfo a where a.accountId = ?1")
//    public AccountInfo findByAccountId(Long accountId);

    @Modifying
    @Query("delete from User where id = :id")
    int deleteUser(@Param("id")Long id);
}
